<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
	require_once '../index.php';
}
   
   else
   {
	$T_NIC_Number=$_POST['T_NIC_Number'];
  $School_Id=$_POST['School_Id'];
  $First_Name=$_POST['First_Name'];
  $Last_Name=$_POST['Last_Name'];
  $Date_Of_Birth=$_POST['Date_Of_Birth'];
  $Gender=$_POST['Gender'];
  $Nature_Of_Appointment=$_POST['Nature_Of_Appointment'];
  $Service=$_POST['Service'];
  $Acadamic_Qualifications=$_POST['Acadamic_Qualifications'];
  $Professional_Qualifications=$_POST['Professional_Qualifications'];
  $Achievements=$_POST['Achievements&Awards'];
  $Address=$_POST['Address'];
  $Mobile_Tp_Number=$_POST['Mobile_Tp_Number'];
  $Home_Tp_Number=$_POST['Home_Tp_Number'];
  $Office_Tp_Number=$_POST['Office_Tp_Number'];
  $Appointment_Date=$_POST['Appointment_Date'];
  $Appointed_Subject=$_POST['Appointed_Subject'];
if($T_NIC_Number!=""&&$School_Id!=""&&$First_Name!=""&&$Last_Name!=""&&$Date_Of_Birth!=""&&$Gender!=""&&$Nature_Of_Appointment!=""&&$Service!=""&&$Acadamic_Qualifications!=""&&$Professional_Qualifications!=""&&$Achievements!=""&&$Address!=""&&$Mobile_Tp_Number!=""&&$Home_Tp_Number!=""&&$Office_Tp_Number!=""&&$Appointment_Date!=""&&$Appointed_Subject!="")
	{
{
$sql=mysql_query("INSERT INTO teacher(T_NIC_Number,School_Id,First_Name,Last_Name,Date_Of_Birth,Gender,Nature_Of_Appointment,Service,Acadamic_Qualifications,Professional_Qualifications,Achievements&Awards,Address,Mobile_Tp_Number,Home_Tp_Number,Office_Tp_Number,Appointment_Date,Appointed_Subject)VALUES('$T_NIC_Number','$School_Id','$First_Name','$Last_Name','$Date_Of_Birth','$Gender','$Nature_Of_Appointment','$Service','$Acadamic_Qualifications','$Professional_Qualifications','$Achievements','$Address','$Mobile_Tp_Number','$Home_Tp_Number','$Office_Tp_Number','$Appointment_Date','$Appointed_Subject')");
if($sql)
  {
$_SESSION['error']="This record is successfully registered!";
  }

  if(!$sql)
  {
$_SESSION['error']="Sorry unable to register this record!";
  }
  }
  if($T_NIC_Number==""||$School_Id==""||$First_Name==""||$Last_Name==""||$Date_Of_Birth==""||$Gender==""||$Nature_Of_Appointment==""||$Service==""||$Acadamic_Qualifications==""||$Professional_Qualifications!=""&&$Achievements==""||$Address==""||$Mobile_Tp_Number==""||$Home_Tp_Number==""||$Office_Tp_Number==""||$Appointment_Date==""||$Appointed_Subject=="")
	{
		
		$_SESSION['errorin']="Please fill all!";
	
	}
   }
?>
</body>
</html>
